
# 汉诺塔程序
def hnt(n,x,y,z):
    if n==1:
        print(x,'----->',z)
    else:
        hnt(n-1,x,z,y)
        print(x,'--->',z)
        hnt(n-1,y,x,z)

hnt(1000,'X','Y','Z')